package com.cskaoyan.day4;

import java.util.Scanner;

public class AvgScore {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入10个成绩");
        double[] scores = new double[10];
        for (int i = 0; i < 10; i++) {
            scores[i] = sc.nextDouble();
        }
        System.out.println("平均成绩为:" + getAvgScore(scores));
    }

    public static double getAvgScore(double[] arr) {
        double sum = 0;
        for (double v : arr) {
            sum += v;
        }
        return sum / 10;
    }
}
